﻿using Client.Framework.Message;
using Client.Model;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Message.Request
{
    class AddEditRoleReq : RequestBaseMessage
    {
        public AddEditRoleReq(int msgId) : base(msgId)
        {

        }

        public ViewRole Role { get; set; }

        public override byte[] Serialize()
        {
            AddEditRole msg = new AddEditRole();
            if (Role != null)
            {
                Role role = new Role
                {
                    Id = Role.ID,
                    RoleName = Role.RoleName,
                    Status = (int)Role.Status
                };
                msg.Role = role;
            }
            return msg.ToByteArray();
        }
    }
}
